

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Dragonborn-zz">
  <meta name="keywords" content="">
  
    <meta name="description" content="# 前置条件 安装 docker, 配置国内镜像源 # 部署命令（使用了一个汉化的版本） 1docker run -d -p 443:443 -p 80:80 -p 222:22 --name gitlab --restart always -v &#x2F;home&#x2F;gitlab&#x2F;config:&#x2F;etc&#x2F;gitlab -v &#x2F;home&#x2F;gitlab&#x2F;logs:&#x2F;var&#x2F;log&#x2F;gitlab -v &#x2F;hom">
<meta property="og:type" content="article">
<meta property="og:title" content="docker部署gitlab私服">
<meta property="og:url" content="http://example.com/2023/04/30/docker%E9%83%A8%E7%BD%B2gitlab%E7%A7%81%E6%9C%8D/index.html">
<meta property="og:site_name" content="Dragonborn-zz&#39;s个人博客">
<meta property="og:description" content="# 前置条件 安装 docker, 配置国内镜像源 # 部署命令（使用了一个汉化的版本） 1docker run -d -p 443:443 -p 80:80 -p 222:22 --name gitlab --restart always -v &#x2F;home&#x2F;gitlab&#x2F;config:&#x2F;etc&#x2F;gitlab -v &#x2F;home&#x2F;gitlab&#x2F;logs:&#x2F;var&#x2F;log&#x2F;gitlab -v &#x2F;hom">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-04-30T00:13:01.000Z">
<meta property="article:modified_time" content="2024-02-18T03:28:48.555Z">
<meta property="article:author" content="Dragonborn-zz">
<meta property="article:tag" content="docker">
<meta property="article:tag" content="gitlab">
<meta name="twitter:card" content="summary_large_image">
  
  
  
  <title>docker部署gitlab私服 - Dragonborn-zz&#39;s个人博客</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.7","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"left","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":{"measurement_id":null},"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml","include_content_in_search":true};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Dragonborn-zz</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/" target="_self">
                <i class="iconfont icon-home-fill"></i>
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/" target="_self">
                <i class="iconfont icon-archive-fill"></i>
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/" target="_self">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/" target="_self">
                <i class="iconfont icon-tags-fill"></i>
                <span>标签</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="https://gitee.com/dragonborn-zz" target="_self">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/home.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="docker部署gitlab私服"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2023-04-30 00:13" pubdate>
          2023年4月30日 凌晨
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          508 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          5 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="padding-left: 2rem; margin-right: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <h1 id="seo-header">docker部署gitlab私服</h1>
            
            
              <div class="markdown-body">
                
                <h4 id="前置条件"><a class="markdownIt-Anchor" href="#前置条件">#</a> 前置条件</h4>
<p>安装 docker, 配置国内镜像源</p>
<h4 id="部署命令使用了一个汉化的版本"><a class="markdownIt-Anchor" href="#部署命令使用了一个汉化的版本">#</a> 部署命令（使用了一个汉化的版本）</h4>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">docker run -d -p <span class="hljs-number">443</span>:<span class="hljs-number">443</span> -p <span class="hljs-number">80</span>:<span class="hljs-number">80</span> -p <span class="hljs-number">222</span>:<span class="hljs-number">22</span> --name gitlab --restart always -v <span class="hljs-regexp">/home/gi</span>tlab<span class="hljs-regexp">/config:/</span>etc<span class="hljs-regexp">/gitlab -v /</span>home<span class="hljs-regexp">/gitlab/</span>logs:<span class="hljs-regexp">/var/</span>log<span class="hljs-regexp">/gitlab -v /</span>home<span class="hljs-regexp">/gitlab/</span>data:<span class="hljs-regexp">/var/</span>opt<span class="hljs-regexp">/gitlab docker.io/</span>twang2218/gitlab-ce-zh<br></code></pre></td></tr></table></figure>
<p>把你服务器的端口映射到容器内部的 443 或者 80</p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">-v <span class="hljs-regexp">/home/gi</span>tlab<span class="hljs-regexp">/config:/</span>etc/gitlab  <br></code></pre></td></tr></table></figure>
<p>这里把容器的配置文件夹映射到服务器真实目录 /home/gitlab/config</p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">-v <span class="hljs-regexp">/home/gi</span>tlab<span class="hljs-regexp">/logs:/</span>var<span class="hljs-regexp">/log/gi</span>tlab<br></code></pre></td></tr></table></figure>
<p>这里把容器的日志文件夹映射到服务器真实目录 /home/gitlab/logs</p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">-v <span class="hljs-regexp">/home/gi</span>tlab<span class="hljs-regexp">/data:/</span>var<span class="hljs-regexp">/opt/gi</span>tlab<br></code></pre></td></tr></table></figure>
<p>这里把容器的存储文件夹映射到服务器真实目录 /home/gitlab/data</p>
<h4 id="进入容器配置gitlab"><a class="markdownIt-Anchor" href="#进入容器配置gitlab">#</a> 进入容器配置 gitlab</h4>
<ul>
<li>1. 进入容器</li>
</ul>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">docker exec -it gitlab <span class="hljs-regexp">/bin/</span>bash<br></code></pre></td></tr></table></figure>
<ul>
<li>2. 修改配置文件</li>
</ul>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">vim <span class="hljs-regexp">/etc/gi</span>tlab/gitlab.rb<br></code></pre></td></tr></table></figure>
<ul>
<li>3. 配置</li>
</ul>
<figure class="highlight livescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><code class="hljs livescript"><span class="hljs-comment">#外部访问地址</span><br> external_url <span class="hljs-string">&#x27;http://124.225.116.118:35236&#x27;</span><br><span class="hljs-comment">#gitlab时区</span><br> gitlab_rails[<span class="hljs-string">&#x27;time_zone&#x27;</span>] = <span class="hljs-string">&#x27;UTC&#x27;</span><br><br><span class="hljs-comment">#gitlab邮件通知</span><br> gitlab_rails[<span class="hljs-string">&#x27;gitlab_email_enabled&#x27;</span>] = <span class="hljs-literal">true</span><br> gitlab_rails[<span class="hljs-string">&#x27;gitlab_email_from&#x27;</span>] = <span class="hljs-string">&#x27;2513178346@qq.com&#x27;</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_enable&#x27;</span>] = <span class="hljs-literal">true</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_address&#x27;</span>] = <span class="hljs-string">&quot;smtp.qq.com&quot;</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_port&#x27;</span>] = <span class="hljs-number">465</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_user_name&#x27;</span>] = <span class="hljs-string">&quot;2513178346@qq.com&quot;</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_password&#x27;</span>] = <span class="hljs-string">&quot;你的&quot;</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_domain&#x27;</span>] = <span class="hljs-string">&quot;qq.com&quot;</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_authentication&#x27;</span>] = <span class="hljs-string">&quot;login&quot;</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_enable_starttls_auto&#x27;</span>] = <span class="hljs-literal">true</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_tls&#x27;</span>] = <span class="hljs-literal">true</span><br> gitlab_rails[<span class="hljs-string">&#x27;smtp_pool&#x27;</span>] = <span class="hljs-literal">true</span><br><span class="hljs-comment">#可选，配置ip限流、白名单</span><br> gitlab_rails[<span class="hljs-string">&#x27;rack_attack_git_basic_auth&#x27;</span>] = &#123;<br>   <span class="hljs-string">&#x27;enabled&#x27;</span> =&gt; <span class="hljs-literal">true</span>,<br>   <span class="hljs-string">&#x27;ip_whitelist&#x27;</span> =&gt; [<span class="hljs-string">&quot;127.0.0.1&quot;</span>],<br>   <span class="hljs-string">&#x27;maxretry&#x27;</span> =&gt; <span class="hljs-number">100</span>,<br>   <span class="hljs-string">&#x27;findtime&#x27;</span> =&gt; <span class="hljs-number">60</span>,<br>   <span class="hljs-string">&#x27;bantime&#x27;</span> =&gt; <span class="hljs-number">3600</span><br> &#125;<br></code></pre></td></tr></table></figure>
<h4 id="重启服务"><a class="markdownIt-Anchor" href="#重启服务">#</a> 重启服务</h4>
<figure class="highlight crmsh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs crmsh">gitlab-ctl <span class="hljs-literal">stop</span><br>gitlab-ctl reconfigure<br>gitlab-ctl <span class="hljs-literal">start</span><br></code></pre></td></tr></table></figure>
<h4 id="一些常见问题"><a class="markdownIt-Anchor" href="#一些常见问题">#</a> 一些常见问题</h4>
<p>1. 同一个 ip 短时间并发可能会触发限流</p>
<p>解决办法</p>
<p>方法一、暂时解决，进入容器执行命令删除 IP 黑名单</p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs awk">redis-cli -s <span class="hljs-regexp">/var/</span>opt<span class="hljs-regexp">/gitlab/</span>redis/redis.socket<br>keys *attack*<br>del <span class="hljs-string">&quot;上一步查到的键值&quot;</span><br></code></pre></td></tr></table></figure>
<p>方法二、加 IP 白名单（如果有固定 ip 可以这么做）或增加并发阈值</p>
<figure class="highlight livescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs livescript"><span class="hljs-comment">#可选，配置ip限流、白名单</span><br> gitlab_rails[<span class="hljs-string">&#x27;rack_attack_git_basic_auth&#x27;</span>] = &#123;<br>   <span class="hljs-string">&#x27;enabled&#x27;</span> =&gt; <span class="hljs-literal">true</span>,<br>   <span class="hljs-comment">#ip白名单</span><br>   <span class="hljs-string">&#x27;ip_whitelist&#x27;</span> =&gt; [<span class="hljs-string">&quot;127.0.0.1&quot;</span>],<br>   <span class="hljs-comment">#并发阈值</span><br>   <span class="hljs-string">&#x27;maxretry&#x27;</span> =&gt; <span class="hljs-number">100</span>,<br>   <span class="hljs-string">&#x27;findtime&#x27;</span> =&gt; <span class="hljs-number">60</span>,<br>   <span class="hljs-string">&#x27;bantime&#x27;</span> =&gt; <span class="hljs-number">3600</span><br> &#125;<br></code></pre></td></tr></table></figure>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E7%8E%AF%E5%A2%83%E9%83%A8%E7%BD%B2/" class="category-chain-item">环境部署</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/docker/" class="print-no-link">#docker</a>
      
        <a href="/tags/gitlab/" class="print-no-link">#gitlab</a>
      
    </div>
  
</div>


              

              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2023/04/30/maven%E9%A1%B9%E7%9B%AE%E8%A7%A3%E5%86%B3lombok%E4%B8%8Emanifold%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98/" title="maven项目解决lombok与manifold兼容问题">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">maven项目解决lombok与manifold兼容问题</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2023/04/30/nginx%E6%90%AD%E5%BB%BA%E6%96%87%E4%BB%B6%E6%9C%8D%E5%8A%A1%E5%99%A8/" title="nginx搭建文件服务器">
                        <span class="hidden-mobile">nginx搭建文件服务器</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
    <!-- 备案信息 ICP for China -->
    <div class="beian">
  <span>
    <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
      皖ICP备2023001508号
    </a>
  </span>
  
</div>

  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.4/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.20.1/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
